<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link href="${pageContext.request.contextPath}/css/nav_top.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
		  integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>seven网上图书商城</title>
<link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css"/>
<link href="${pageContext.request.contextPath}/css/product.css" rel="stylesheet" type="text/css"/>
  <script type="text/javascript">
       //传递当前页和cid
       function gotopage(page,cid){
    	   window.location.href="${pageContext.request.contextPath}/product_findByCid?page="+page+"&cid="+cid+"";
       }
  </script>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/tit.ico" type="image/x-icon" />
<script>
    createSnow('', 60);
</script>
	<link href="${pageContext.request.contextPath}/css/nav_top.css" rel="stylesheet" type="text/css"/>
	<style type="text/css">
		body{margin:0px;padding:0px;}
		.cls{clear:both;}
		a:focus{outline:none;}

		.menu{height:48px;display:block;padding:0px;width:999px;margin:40px auto 0 auto;}
		.menu ul{list-style:none;padding:0;margin:0;}
		.menu ul li{float:left;overflow:hidden;position:relative;line-height:48px;text-align:center;}
		.menu ul li a{position:relative;display:block;width:111px;height:48px;font-family:"微软雅黑", "宋体";font-size:14px;text-decoration:none;cursor:pointer;font-weight:bold;line-height:48px;}
		.menu ul li a span{position:absolute;left:0;width:111px;}
		.menu ul li a span.out{top:0px;}
		.menu ul li a span.over,  .menu ul li a span.bg{top:-48px;}
		#menu2{background-image:url(../images/s_03.jpg);background-repeat:repeat;}
		#menu2 ul li a span{color: black}
		#menu2 ul li a span.over{color:red;height:48px;width:111px;background-image:url(../images/w_03.jpg);background-repeat:repeat;}
	</style>

	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>

</head>
<body>

<table>
	<div class="container header">
		<div class="span5">
			<div class="logo">
				<a href="http://localhost:8080/mango/">
					<img src="${pageContext.request.contextPath}/images/018.png" alt="seven图书商城"/>
				</a>
			</div>
		</div>
		<div class="span9">
			<div class="headerAd">
				<img src="${pageContext.request.contextPath}/images/header.jpg" width="320" height="50" alt="正品保障" title="正品保障"/>
			</div>
		</div>

	</div>
	<div id="menu2" class="menu">
		<ul>
			<li> <a  href="${pageContext.request.contextPath}/app/category/index">首页</a></li>
			<c:forEach var="c" items="${list}" begin="0" end="4">
				<li> <a  href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${c.categoryname}&start=1">${c.categoryname}</a></li>
			</c:forEach>
		</ul>
		<div class="cls"></div>
	</div>
	<%--

        <form id="productForm" action="${pageContext.request.contextPath}/image/蔬菜 - Powered By Mango Team.htm" method="get">
            <input type="hidden" id="brandId" name="brandId" value=""/>
            <input type="hidden" id="promotionId" name="promotionId" value=""/>
            <input type="hidden" id="orderType" name="orderType" value=""/>
            <input type="hidden" id="pageNumber" name="pageNumber" value="1"/>
            <input type="hidden" id="pageSize" name="pageSize" value="20"/>
        </form>
            --%>
	<div id="result" style="margin: 0 auto">
		<ul>
			<c:forEach  var="p" items="${categoryList}">
				<div style="width: 200px;height: 250px;float: left;margin-left: 10% ">
					<li style="float: left">
						<a href="${pageContext.request.contextPath}/app/Evaluate/findEvaluateByBsidAndUid?bsid=${p.bsid}">
							<img src="${pageContext.request.contextPath}/web-image/book-image/${p.image}" width="170" height="170"  style="display:inline-block;"/>
							<span class="pname">
									${p.bname}
							</span>
							<span class="price" style='color:#ff3300;'>
												商城价： ￥${p.price}
											</span>
						</a>
					</li>
				</div>

			</c:forEach>
		</ul>
	</div>

  </table>

<div style="clear: both"/>
	<%--显示分页 =====================================================================--%>
<table>
  <div align="center" style="color: white">
    <span style="color: red">第${page. pageNum}页/共${page.pages}页</span>
    <br>
    <a style="color:red;text-decoration: none" href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${categoryname}&start=1">首页</a>
    <c:if test="${page.hasPreviousPage}">
      <a style="color: red;text-decoration: none"  href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${categoryname}&start=${page.prePage}">上一页</a>
    </c:if>
    <c:forEach var="num" begin="1" end="${page.pages}">
      <c:choose>
        <c:when test="${num==page.pageNum}">
          <span style="color:red;">${num}</span>
        </c:when>
        <c:otherwise>
          <a style="color:red;text-decoration: none" href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${categoryname}&start=${num}">[${num}]</a>
        </c:otherwise>
      </c:choose>
    </c:forEach>
    <c:if test="${page.hasNextPage}">
      <a style="color:red;text-decoration: none" href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${categoryname}&start=${page.nextPage}">下一页</a>
    </c:if>
    <a style="color: red;text-decoration: none" href="${pageContext.request.contextPath}/app/category/byCategory?categoryname=${categoryname}&start=${page.pages}">尾页</a>
  </div>
</table>


	<%--尾部 --%>
	<%@ include file="bottom.jsp" %>
</body>
</html>
